/**
 * Copyright (C) 2009+ Spark Zheng
 *
 * @file        src/mont_types.h 
 * @date        2010-05-11
 * @brief	general_network
 * @see         dserver
 * @history
 */

#ifndef _DSERVER_MONT_TYPES_H
#define _DSERVER_MONT_TYPES_H

#ifdef __cplusplus
extern "C" {
#endif

#include <dlib/global.h>

#include "utils.h"
#include "connection.h"
#include "prot_types.h"

/**
 * dserver_monitor_init
 * @brief common server monitor init
 * @param host: monitor listened on host & port
 * @param port: monitor listened on host & port
 * @param timeout: protocol timeout
 */
extern prot_node_t *dserver_monitor_init(const char *host, in_port_t port, uint16_t timeout);

/**
 * dserver_monitor_exit
 * @brief common server monitor destroy
 * @param monitor: monitor protocol
 */
extern void dserver_monitor_exit(prot_node_t *monitor);

extern int dserver_monitor_session_init(void *arg);

extern prot_ret_t dserver_monitor_session_worker(void *arg);

extern void dserver_monitor_session_exit(void *arg);

#ifdef __cplusplus
}
#endif
#endif
